package myannotion.springmvc;

import myannotion.springmvc.aspect.AspectTest;
import org.springframework.context.annotation.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author sss
 * @date 2020-02-19 13:38
 **/
@Configuration
@ComponentScan(value = {"myannotion.springmvc"},includeFilters = {@ComponentScan.Filter(
        type = FilterType.ANNOTATION,classes = Controller.class)},useDefaultFilters = false)
@EnableAspectJAutoProxy
public class AppConfig extends WebMvcConfigurationSupport {
	@Bean
	public AspectTest aspectTest(){
		return new AspectTest();
	}
//	@Override
//	protected void addInterceptors(InterceptorRegistry registry) {
//		registry.addInterceptor(new MyInterceptor()).addPathPatterns("/*");
//		super.addInterceptors(registry);
//	}
}
